1 study design

  • 5 mice per cage, 4 groups (3 treatment group, 1 control group). Samples (feces) were taken every week and frozen. Application of AB via drinking water. No large difference in consumption of water between groups.
  • 4 rounds of AB in total with a gap after the first two rounds (resilience phase)

1.1 tested antibiotics

AB Class
Ciprofloxacin Fluoroquinolone
Tetracyclin Polyketide
Vancomycin Glycopeptide

1.2 community members

ID phylum species
YL44 Verrucomicrobia A. muciniphila
I48 Bacteroidetes B. caecimuris
YL27 Bacteroidetes M. intestinale
YL45 Proteobacteria T. muris
YL2 Actinobacteria B. longum
KB1 Firmicutes E. faecalis
KB18 Firmicutes A. muris
YL32 Firmicutes C. clostridioforme
YL31 Firmicutes F. plautii
YL58 Firmicutes B. coccoides
I49 Firmicutes L. reuteri
I46 Firmicutes C. innocuum

2 analysis of qPCR data

2.3 visualisation of microbiota dynamic over study time

2.3.1 all

dat.summary <- aggregate(. ~ day, mean, data = dat.m)
treatment <- data.frame(begin = c(1, 15),
                        end = c(10, 20))
p <- ggplot(dat.m, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_grid(variable ~ group) + scale_y_log10()
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p

2.3.2 water group

dat.m_subset <- dat.m[which(dat.m$group == "water"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_wrap(~variable) + scale_y_log10()
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("absolute abundance in control group")
p

2.3.3 Ciprofloxacin group

dat.m_subset <- dat.m[which(dat.m$group == "Ciprofloxacin"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_wrap(~variable) + scale_y_log10()
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("absolute abundance in Ciprofloxacin group")
p

2.3.4 Tetracyclin group

dat.m_subset <- dat.m[which(dat.m$group == "Tetracyclin"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_wrap(~variable) + scale_y_log10() 
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("absolute abundance in Tetracyclin group")
p

2.3.5 Tetracyclin group (free scale)

dat.m_subset <- dat.m[which(dat.m$group == "Tetracyclin"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
#p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
#p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_wrap(~variable, scales = "free") + scale_y_log10() 
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("absolute abundance in Tetracyclin group")
p

2.3.6 Vancomycin group

dat.m_subset <- dat.m[which(dat.m$group == "Vancomycin"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + facet_wrap(~variable) + scale_y_log10()
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("absolute abundance in Vancomycin group")
p

2.3.7 Tetracyclin C. innocuum

dat.m_subset <- dat.m[which(dat.m$group == "Tetracyclin"),]
dat.m_subset <- dat.m_subset[which(dat.m_subset$variable == "M.intestinale"),]

p <- ggplot(dat.m_subset, aes(x = day, value, color = mouse2)) 
# annotate AB application
p <- p + geom_rect(xmin = 0, xmax = 4,ymin = -Inf, ymax = Inf, color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 14, xmax = 18,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 49, xmax = 53,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
p <- p + geom_rect(xmin = 64, xmax = 68,ymin = -Inf, ymax = Inf,  color = "grey90", fill = "grey90", alpha = .1) 
# annotate LOD
#p <- p + geom_hline(data = lod_upper, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
#p <- p + geom_hline(data = lod_lower, aes(yintercept = value), linetype = 1, size = 0.2, color = "black")
p <- p + stat_summary(fun.y = mean, fun.ymin = mean, fun.ymax = mean, geom = "line", color = "black")
p <- p + geom_jitter(size = 0.5,  show.legend = FALSE) 
p <- p + scale_colour_brewer(palette = "Set1") + theme_pmuench()
p <- p + xlab("time (days)") + ylab("copies/g feces (log10)") #+ annotation_logticks( sides = "l")
p <- p + theme( panel.background = element_blank(),panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),plot.background = element_blank())# + geom_smooth()
p <- p + theme(legend.title = element_blank()) + 
       theme(strip.text.y = element_text(size = 6, colour = "black", face = "italic",angle = 0))
p <- p + ggtitle("C.innocuum in Tetracyclin group")
p <- p + ylim(c(min(dat.m_subset$value), max(dat.m_subset$value)))
p

2.4 classical PCOA by treatment state

2.4.1 scaled (RA)

dat <- read.table("values.csv", header = T, sep = ";")
dat$universal <- NULL
rownames(dat) <- paste0(dat$group, "-", dat$mouse2, "-", dat$day)
type <- dat$group
day <- dat$day
dat[,c(1:5)] <- NULL

day2 <- rep("none", length(day))
day2[which(day == 0)] <- "before treatment"
day2[which(day == 4)] <- "treatment response"
day2[which(day == 18)] <- "treatment response"
day2[which(day == 53)] <- "treatment response"
day2[which(day == 67)] <- "treatment response"
day2[which(day > 67)] <- "after treatment"
day2[which(day2 == "none")] <- "resilience"

dat_t <- t(as.data.frame(dat))
dat_scaled <- scale(dat_t, center = FALSE, scale = colSums(dat_t))
dat <- t(as.data.frame(dat_scaled))
# generating distance matrix
dist <- vegan::vegdist(dat, method = 'bray')
pcoa <- cmdscale(dist, k = 2, eig = TRUE)
# generate the data frame for plotting, consisting of coordinates and the annotation
coordinates <- data.frame(
  pcoa1 = pcoa$points[,1],
  pcoa2 = pcoa$points[,2],
  type = type,
  round = day2,
  time = day,
  row.names = NULL
)
# calculated explained variance
eigenvalues <- eigenvals(pcoa) 
variance <- eigenvalues / sum(eigenvalues) 
variance1 <- 100 * round(variance[1], digits = 3)
variance2 <- 100 * round(variance[2], digits = 3)
  
# plotting
p <- ggplot(coordinates, aes(x = pcoa1, y = pcoa2, color = day2))
p <- p + geom_point(alpha = 1, stroke = 0, aes(shape = type), size = 1)
#p <- p + scale_size(range = c(2, 6), name = "time (day)")
p <- p + xlab(paste("PCo 1 (", round(variance1), "%)", sep = ""))
p <- p + ylab(paste("PCo  2 (", round(variance2), "%)", sep = ""))
p <- p + theme(plot.title = element_text(size = 8),
               axis.title.x = element_text(size = 8),
               axis.title.y = element_text(size = 8))
p <- p + theme(plot.title = element_text(size = 8),
               axis.title.x = element_text(size = 8),
               axis.title.y = element_text(size = 8))
p <- p + scale_colour_brewer(palette = "Set1", name = "state", direction = -1)
p <- p + scale_shape_manual(values = c(16, 17, 15, 1), name = "group")
p <- p + theme_bw() + geom_hline(yintercept = 0, linetype = 3)
p <- p + geom_vline(xintercept = 0, linetype = 3)
p <- p + theme(aspect.ratio = 1)
p

2.4.2 unscaled

dat <- read.table("values.csv", header = T, sep = ";")
dat$universal <- NULL
rownames(dat) <- paste0(dat$group, "-", dat$mouse2, "-", dat$day)
type <- dat$group
day <- dat$day
dat[,c(1:5)] <- NULL

day2 <- rep("none", length(day))
day2[which(day == 0)] <- "before treatment"
day2[which(day == 4)] <- "treatment response"
day2[which(day == 18)] <- "treatment response"
day2[which(day == 53)] <- "treatment response"
day2[which(day == 67)] <- "treatment response"
day2[which(day > 67)] <- "after treatment"
day2[which(day2 == "none")] <- "resilience"

# generating distance matrix
dist <- vegan::vegdist(dat, method = 'bray')
pcoa <- cmdscale(dist, k = 2, eig = TRUE)
# generate the data frame for plotting, consisting of coordinates and the annotation
coordinates <- data.frame(
  pcoa1 = pcoa$points[,1],
  pcoa2 = pcoa$points[,2],
  type = type,
  round = day2,
  time = day,
  row.names = NULL
)
# calculated explained variance
eigenvalues <- eigenvals(pcoa) 
variance <- eigenvalues / sum(eigenvalues) 
variance1 <- 100 * round(variance[1], digits = 3)
variance2 <- 100 * round(variance[2], digits = 3)
  
# plotting
p <- ggplot(coordinates, aes(x = pcoa1, y = pcoa2, color = day2))
p <- p + geom_point(alpha = 1, stroke = 0, aes(shape = type), size = 1)
#p <- p + scale_size(range = c(2, 6), name = "time (day)")
p <- p + xlab(paste("PCo 1 (", round(variance1), "%)", sep = ""))
p <- p + ylab(paste("PCo  2 (", round(variance2), "%)", sep = ""))
p <- p + theme(plot.title = element_text(size = 8),
               axis.title.x = element_text(size = 8),
               axis.title.y = element_text(size = 8))
p <- p + theme(plot.title = element_text(size = 8),
               axis.title.x = element_text(size = 8),
               axis.title.y = element_text(size = 8))
p <- p + scale_colour_brewer(palette = "Set1", name = "state", direction = -1)
p <- p + scale_shape_manual(values = c(16, 17, 15, 1), name = "group")
p <- p + theme_bw() + geom_hline(yintercept = 0, linetype = 3)
p <- p + geom_vline(xintercept = 0, linetype = 3)
p <- p + theme(aspect.ratio = 1)
p

2.4.4 animated PCOA by study time (RA)

dat <- read.table("values.csv", header = T, sep = ";")
dat$universal <- NULL
rownames(dat) <- paste0(dat$group, "-", dat$mouse2, "-", dat$day)
type <- dat$group
day <- dat$day
dat[,c(1:5)] <- NULL

day2 <- rep("none", length(day))
day2[which(day == 0)] <- "before treatment"
day2[which(day == 4)] <- "treatment response"
day2[which(day == 18)] <- "treatment response"
day2[which(day == 53)] <- "treatment response"
day2[which(day == 67)] <- "treatment response"
day2[which(day > 67)] <- "after treatment"
day2[which(day2 == "none")] <- "resilience"

dat_t <- t(as.data.frame(dat))
dat_scaled <- scale(dat_t, center = FALSE, scale = colSums(dat_t))
dat <- t(as.data.frame(dat_scaled))
# generating distance matrix
dist <- vegan::vegdist(dat, method = 'bray')
pcoa <- cmdscale(dist, k = 2, eig = TRUE)
# generate the data frame for plotting, consisting of coordinates and the annotation
coordinates <- data.frame(
  pcoa1 = pcoa$points[,1],
  pcoa2 = pcoa$points[,2],
  type = type,
  round = day2,
  time = day,
  row.names = NULL
)
ggplot(coordinates, aes(x = pcoa1, y = pcoa2, colour = type, size = day, shape = type)) +
  geom_point(alpha = 0.7, show.legend = TRUE) +
  scale_colour_brewer(palette = "Set1", name = "group", direction = 1) +
  theme_bw() + geom_hline(yintercept = 0, linetype = 3) + 
  scale_shape_manual(values = c(16, 17, 15, 1), name = "group") + 
  geom_vline(xintercept = 0, linetype = 3) + scale_size(range = c(2, 6)) +
  theme(aspect.ratio = 1) +
  # Here comes the gganimate specific bits
  labs(title = 'time (days): {frame_time}', x = 'PCo 1', y = 'PCo 2') +
  transition_time(time) +
  ease_aes('linear') + 
  enter_fade() + 
  exit_fade()

2.4.5 non-animated PCOA by study time, three time points

dat <- read.table("values.csv", header = T, sep = ";")
dat$universal <- NULL
rownames(dat) <- paste0(dat$group, "-", dat$mouse2, "-", dat$day)
type <- dat$group
day <- dat$day
dat[,c(1:5)] <- NULL

day2 <- rep("none", length(day))
day2[which(day == 0)] <- "before treatment"
day2[which(day == 4)] <- "treatment response"
day2[which(day == 18)] <- "treatment response"
day2[which(day == 53)] <- "treatment response"
day2[which(day == 67)] <- "treatment response"
day2[which(day > 67)] <- "after treatment"
day2[which(day2 == "none")] <- "resilience"

dat_t <- t(as.data.frame(dat))
dat_scaled <- scale(dat_t, center = FALSE, scale = colSums(dat_t))
dat <- t(as.data.frame(dat_scaled))
# generating distance matrix
dist <- vegan::vegdist(dat, method = 'bray')
pcoa <- cmdscale(dist, k = 2, eig = TRUE)
# generate the data frame for plotting, consisting of coordinates and the annotation
coordinates <- data.frame(
  pcoa1 = pcoa$points[,1],
  pcoa2 = pcoa$points[,2],
  type = type,
  round = day2,
  time = day,
  row.names = NULL
)

generateOnePCOA <- function(dat, day=4) {
  dat_day <- coordinates[which(coordinates$time == as.numeric(day)),]
  p <- ggplot(dat_day, aes(x = pcoa1, y = pcoa2, colour = type, shape = type))
  p <- p + geom_point(alpha = 0.7, show.legend = TRUE) 
  p <- p + xlim(min(dat$pcoa1), max(dat$pcoa1))
  p <- p + ylim(min(dat$pcoa2), max(dat$pcoa2))
  p <- p + scale_colour_brewer(palette = "Set1", name = "group", direction = 1) 
  p <- p + theme_pmuench() + geom_hline(yintercept = 0, linetype = 3) 
  p <- p + scale_shape_manual(values = c(16, 17, 15, 1), name = "group")
  p <- p + geom_vline(xintercept = 0, linetype = 3) + scale_size(range = c(2, 6))
  p <- p + theme(aspect.ratio = 1) +   labs(title = paste0('time (days): ', as.character(day)), x = 'PCo 1', y = 'PCo 2') + theme(legend.position = "none")
  return(p)
}

d0 <- generateOnePCOA(coordinates, day = 0)
d4 <- generateOnePCOA(coordinates, day = 4)
d44 <- generateOnePCOA(coordinates, day = 44)
d67 <- generateOnePCOA(coordinates, day = 67)
pdf(file="pcoa_time.pdf")
grid.arrange(d0, d4, d44, d67, nrow = 2)

dev.off()
## quartz_off_screen 
##                 2

2.7 barplot

dat <- read.table("values.csv", header = T, sep = ";")
mouse <- dat$mouse2
# normalize by 16 rRNA gene copy number
dat$I46 <- dat$I46 / 5
dat$I48 <- dat$I48 / 3
dat$I49 <- dat$I49 / 6
dat$KB1 <- dat$KB1 / 4
dat$KB18 <- dat$KB18 / 2
dat$YL2 <- dat$YL2 / 3
dat$YL27 <- dat$YL27 / 4
dat$YL31 <- dat$YL31 / 2
dat$YL32 <- dat$YL32 / 5
dat$YL44 <- dat$YL44 / 3
dat$YL45 <- dat$YL45 / 6
dat$YL58 <- dat$YL58 / 5

dat$universal <- NULL
dat[,c(1:5)] <- NULL
dat_t <- t(as.data.frame(dat))
dat_scaled <- scale(dat_t, center = FALSE, scale = colSums(dat_t))
dat <- as.data.frame(t(as.data.frame(dat_scaled)))
dat$group <- type
dat$day <- day
dat$mouse <- mouse
df.m <- melt(dat, id.vars = c("day", "group", "mouse"))
df.m$value <- as.numeric(df.m$value)

p <- ggplot(df.m, aes(x = day, y = value, fill = variable))
p <- p + facet_grid(mouse ~ group) 
#p <- p  + geom_bar(stat = "identity")
p <- p + geom_area()
p <- p + geom_rect(data = df.m, xmin = 0, xmax = 4,ymin = 0, ymax = 1, color = "grey50", fill = NA, alpha = .5, size = 0.2)
p <- p + geom_rect(data = df.m, xmin = 0, xmax = 4,ymin = 0, ymax = 1, color = "grey50", fill = NA, alpha = .5, size = 0.2)
p <- p + geom_rect(data = df.m, xmin = 14, xmax = 18,ymin = 0, ymax = 1, color = "grey50", fill = NA, alpha = .5, size = 0.2)
p <- p + geom_rect(data = df.m, xmin = 49, xmax = 53,ymin = 0, ymax = 1, color = "grey50", fill = NA, alpha = .5, size = 0.2)
p <- p + geom_rect(data = df.m, xmin = 64, xmax = 68,ymin = 0, ymax = 1, color = "grey50", fill = NA, alpha = .5, size = 0.2)
p <- p + theme_pmuench()
## Warning: `panel.margin` is deprecated. Please use `panel.spacing` property
## instead
## Warning: `legend.margin` must be specified using `margin()`. For the old
## behavior use legend.spacing

2.8 analyse universal primer

## Warning: `panel.margin` is deprecated. Please use `panel.spacing` property
## instead
## Warning: `legend.margin` must be specified using `margin()`. For the old
## behavior use legend.spacing

2.9 analyse universal primer

## Warning: `panel.margin` is deprecated. Please use `panel.spacing` property
## instead
## Warning: `legend.margin` must be specified using `margin()`. For the old
## behavior use legend.spacing